package com.yf.user.mapper;

//import org.apache.ibatis.annotations.*;
import com.yf.user.domain.DrMemberCarry;

import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public interface DrMemberCarryDAO {
	/**
	 * 添加提现
	 */
    void insertDrMemberCarry(DrMemberCarry drMemberCarry) throws SQLException;
    
	/**
	 * 修改状态
	 */
    void updateStatusById(DrMemberCarry drMemberCarry) throws SQLException;
	
	/**
	 *  查询当天提现次数
	 */
	Integer countOneDayCarryTimes(Integer uid);

	/**
	 * 根据流水号插入订单
	 */
	void insertSelective(DrMemberCarry drMemberCarry);


//	@Select("select * from dr_member_carry where paymentnum=#{paymentNum} for update")
//	DrMemberCarry getByPaymentNumForUpdate(String paymentNum);

	/**
	 *  查询用户当天的提现记录
	 */
	List<DrMemberCarry> listMemberCarryInOneDayByUid(Integer uid);

//	@Select("SELECT count(1) FROM dr_member_carry WHERE STATUS = 2 AND TO_DAYS(addtime) = TO_DAYS(NOW()) AND uid = #{uid}")
//	Integer countSuccessCarryTimesInOneDay(Integer uid);

//	@Select("SELECT SUM(amount) FROM dr_member_carry WHERE STATUS = 2 AND cashWay = 'T+0' and AddTime BETWEEN\n" +
//			"DATE_SUB(#{clearTime},INTERVAL 1 DAY) AND #{clearTime}")
//	BigDecimal getAlreadyAdvanceAmountByClearTime(Date clearTime);

//	@Select("SELECT SUM(amount) FROM dr_member_carry WHERE STATUS = 2 AND cashWay = 'T+0' and AddTime BETWEEN " +
//			"#{0} AND #{1}")
//	BigDecimal countAlreadyAdvanceAmount(Date from, Date to);
}